﻿/**********************************************************************
 * @file   FITKFESubSysGeoProp.h
 * @brief  FE子系统几何属性计算
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2025-01-15
 *********************************************************************/
#ifndef _FITK_FESUB_SYS_GEOPROP_H___
#define _FITK_FESUB_SYS_GEOPROP_H___
 
#include "FITKAcousticsModelAPI.h"
#include <QList>
#include <QPair>
#include <QHash>

namespace Core
{
    class FITKNode;
}

namespace Acoustics
{
    class FITKAbstractFESubSys;
    /**
     * @brief 子系统的几何属性计算
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2025-01-15
     */
    class FITKAcousticsModelAPI FITKFESubSysGeoProp
    {
    public:
        /**
         * @brief 几何属性类型
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-15
         */
        enum FESubSysGeoPropType
        {
            Circumference,  ///< 周长 -梁的长度
            Area,           ///< 面积
            Volume,         ///< 体积
        };
    public:
        /**
         * @brief Construct a new FITKFESubSysGeoProp object
         * @param[i]  subsys        子系统对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-15
         */
        explicit FITKFESubSysGeoProp(FITKAbstractFESubSys* subsys);
        /**
         * @brief Destroy the FITKFESubSysGeoProp object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-15
         */
        virtual ~FITKFESubSysGeoProp() = default;
        /**
         * @brief 更新几何属性
         * @return true   更新成功
         * @return false   更新失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-15
         */
        bool updateProp();
        /**
         * @brief 获取几何属性
         * @param[i]  t          几何属性类型
         * @return double 
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-15
         */
        double getGeoProp(FESubSysGeoPropType t);
        /**
         * @brief    获取边界节点id对
         * @return   QList<QPair<int,int>>
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-13
         */
        QList<QPair<int, int>> getBoundary();
        /**
         * @brief    获取维度属性
         * @return   int 1-Beam 2-Shell 3-Acoustic -1:失败
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-07
         */
        int getDimProp();

    private:
        /**
         * @brief    计算维度
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-07
         */
        void calculateDimProp();
        /**
         * @brief    计算梁结构属性
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-15
         */
        void calculateBeamStructureProp();
        /**
         * @brief    计算壳结构属性
         * @author   LiBaojun (libaojunqd@foxmail.com)
         * @date     2024-11-05
         */
        void calculateShellStructureProp();
        /**
         * @brief 计算腔体属性
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-05
         */
        void calculateAcousticProp();

    private:
         /**
          * @brief  边界节点对
          * @author liuzhonghua (liuzhonghuaszch@163.com)
          * @date   2024-11-13
          */
        QList<QPair<int, int>> _boundaryNodes{};
        /**
         * @brief 几何属性  周长 面积  体积
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-05
         */ 
        double _geoprop[3] = { 1,1,1 };
        /**
         * @brief  维度 1-Beam 2-Shell 3-Acoustic -1:失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-07
         */
        int _dim{ -1 };
        /**
         * @brief  SEA子系统的数据对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-19
         */
        FITKAbstractFESubSys* _subSys{};
    };
}


#endif
